home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
program
/
4th86_v4.zip
/
WHY.UCC
< prev
Wrap
Text File
|
1993-12-09
|
7KB
|
178 lines
4th_86 version 4.01 WHY.UCC page 1
( November 1993 - 4th_86 version 4.01 - MFB )
Introduction
============
The **primary** objective of 4th_86 is to provide a version of
FORTH which is specifically designed to make the learning curve for
newcomers an easy -- and interesting one.
There are many existing implementations of FORTH -- both
commercial and Shareware. While these are excellent in their way -- they
appear to be written solely from the viewpoint of compiling efficient
user code -- and not with any sympathy for the normal difficulties a
newcomer faces in learning FORTH -- much less the difficulties imparted
by the unfair reputation FORTH has for being "obscure" and
"unconventional".
It is not claimed that 4th_86 is either "conventional" in FORTH
traditional terms -- nor that it is particularly efficient or fast as a
"code producing mill". It is however not *so* far removed from the
conventional FORTH approach as to make the transition for a learner
difficult. Indeed -- the whole objective is that the learner will be able
to "find his feet" here -- and should he then wish -- progress to the
Shareware world -- or to commercial versions.
This translation and extension attempts to maintain the clarity of
the original UCC 4th -- and indeed extend it's appeal to newcomers by
replacing the conventional FORTH blank screen and OK prompt with an
interactive HELP tutorial.
It is also believed to be quite capable of producing fully
functional code, and it is hoped that users will find it just as
"functional" in its own way as many of the other versions avaliabe.
Cross Platform Portability
==========================
In line with the philosophy of FORTH -- much of 4th_86 was
written in 4th_86. There has been no attempt at portability across
hardware platforms however, and to conserve speed a great deal has been
written in assembly language with a conventional 8086 assembler.
As 4th_86 is heavily IBM-PC oriented in concept; conversion to
another platform would be largely meaningless. For this reason the
original FORTH concept of minimising the assembly content to a small
KERNEL of assembly in order to simplify cross-platform recompilation has
been abandoned. Inbuilt DOS and PC-BIOS routines have been heavily used
where it is felt they offer advantages.
4th_86 version 4.01 WHY.UCC page 2
4th_86
a) uses PC BIOS routines -- especially Int 10H for video output
b) implements EGA and CGA graphics
c) uses BIOS window-scrolling routines and GOTXY and GETXY
d) uses DOS INT 21H file-handles and modes for acccessing disk
files
e) uses the concept of shelling to DOS and executing conventional
DOS programs as child processes -- specifically DOS editors
and Assemblers.
f) version 4.01 takes advantage of segment addressing to separate
dictionary; cross compile; code; and scratch areas into
separate 64K segments
e) assumes that the user is capable of using a keyboard and normal
command line entry.
The tutorial shows that windows producing code is quite
easily implemented -- and at a later date some basic mouse-
access words will be issued as source code.
History
=======
UCC 4th was originally marketed by United Controls Corporation
in 1982, for 8-bit hardware. Originally written for in-house use, it
only marketed for a short time, and with limited advertising. For this
reason very few copies were sold, and despite its innovative excellence,
appears to be comparatively un-known even amongst Forth enthusiasts.
This version 4.01 has both an in line and an external assembler
adhering to conventional MASM format and mnemonics. It also has separate
64K segments for dictionary; for cross compile code; and for direct input
code.
There are several highly professional and extremely comprehensive
FORTH packages for the PC now -- as well as several excellent Public
Domain versions. Despite these, FORTH is widely ignored, and indeed is
often regarded with disdain by "conventional" programmers. So what
justification is there for resurrecting and faithfully maintaining the
flavour of an old 8-bit version?
The purpose of this translation and major expansion of UCC Forth is
still to provide a teaching tool. It is a fully useable interpreter and
compiler -- but the whole structure of the documentation -- and the on-
line HELP tutorial -- is one of helping newcomers to UNDERSTAND Forth.
4th_86 version 4.01 WHY.UCC page 3
4th_86 vs. "the others"
=======================
Hopefully there is no "competition" as such. The spirit of FORTH
lives in all implementations, but mostly it is disguised in a world of
non-readable, non-printable 1024 byte screens; non standard disk I/O;
inbuilt oddities of editors; plus numerous "conversion" utilities to make
it reluctantly interact with the "real" world.
Under the above aura of user-unfriendliness, the minor hurdles of
reverse polish notation and special character symbols ( both of which
are an essential part of the FORTH concept ) seem insurmountable, and
never receive from a novice the attention and understanding they merit.
4th_86 makes no attempt to adhere to "tradition" where simpler and more
comprehensible techniques seem beneficial. For example -- conventional
Forths have a flag called BASE which defines the number base.
To input a number in decimal -- and print it in Hex would require
10 BASE ! 13 16 BASE ! .
and the result displayed would be 000D Hex.
In 4th_86 version 4.01 the variable BASE does not exist. [ It
used to exist in earlier versions - but was used in a different context -
- as an offset for the cross compiler ]. To input a number type it as you
would in MASM. The above code would simply be
13 .H
.H prints in Hex just as . prints in decimal and .Q in octal and
.B in binary.
23H puts 23 Hex on the stack. 23 puts 23 Decimal on the stack
23Q puts 23 Octal etc.
This means that you can easily mix bases
23H 13 + .H will display 0030 as the Hex value.
Similarly data types such as BLOCK CONST DATA[ ... ] etc are not as in
more conventional models -- and the leading string delimiter is now just
that -- instead of a hybrid delimiter plus print word.
conventional => ." this is a test "
4th_86 => " this is a test " ."
As a beginner, you need not worry about these variations. They are fully
detailed in the documentation however.